home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 001 / pibt32s1.arc / CAPTUREC.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1985-10-30  |  2.5 KB  |  56 lines

  1. (*----------------------------------------------------------------------*)
  2. (*          Capture_Char -- write character to capture file             *)
  3. (*----------------------------------------------------------------------*)
  4.  
  5. PROCEDURE Capture_Char( Ch : CHAR );
  6.  
  7. (*----------------------------------------------------------------------*)
  8. (*                                                                      *)
  9. (*     Procedure:  Capture_Char                                         *)
  10. (*                                                                      *)
  11. (*     Purpose:    Writes character to capture file                     *)
  12. (*                                                                      *)
  13. (*     Calling Sequence:                                                *)
  14. (*                                                                      *)
  15. (*        Capture_Char( Ch : CHAR );                                    *)
  16. (*                                                                      *)
  17. (*           Ch --- the character to be written out                     *)
  18. (*                                                                      *)
  19. (*     Remarks:                                                         *)
  20. (*                                                                      *)
  21. (*        If Exact_Capture is TRUE, then characters are written just    *)
  22. (*        as they are received.  If Exact_Capture is FALSE, then        *)
  23. (*        a full screen image line is gathered up and written when      *)
  24. (*        an LF or FF is encountered.                                   *)
  25. (*                                                                      *)
  26. (*----------------------------------------------------------------------*)
  27.  
  28. VAR
  29.    Screen_Line : STRING[80];
  30.    IY          : INTEGER;
  31.  
  32. BEGIN (* Capture_Char *)
  33.  
  34.    IF Exact_Capture THEN
  35.       IF ( Ch = CHR( LF ) ) THEN
  36.          WRITELN( Capture_File )
  37.       ELSE
  38.          WRITE( Capture_File , Ch )
  39.    ELSE
  40.       IF ( Ch = CHR( LF ) ) THEN
  41.          BEGIN
  42.             IY := WhereY;
  43.             Get_Screen_Text_Line( Screen_Line , IY, 1 );
  44.             Screen_Line := Trim( Screen_Line );
  45.             WRITELN( Capture_File , Screen_Line );
  46.          END
  47.       ELSE IF ( Ch = CHR( FF ) ) THEN
  48.          BEGIN
  49.             IY := WhereY;
  50.             Get_Screen_Text_Line( Screen_Line , IY, 1 );
  51.             Screen_Line := Trim( Screen_Line );
  52.             WRITELN( Capture_File , Screen_Line );
  53.             WRITELN( Ch );
  54.          END;
  55.  
  56. END   (* Capture_Char *);